import store from '@/store'
import { getAuditOrderList,getSemiFinishProductList} from "@/api/product"
import {getCompanyName} from '@/api/user'

//msg_shenhe
export function getshenhemsg(){
    get_AuditOrder()
    get_SemiFinishProductList()
    setInterval(() => {
        get_AuditOrder()
        get_SemiFinishProductList()
    },100000);
}


// 获取可审核数量
function get_AuditOrder(){
    getAuditOrderList({per_page:1000}).then(res=>{
        if(res.code==200){
           let msg= res.data.data.length
           store.state.app.msglist.shenhemsg=msg
        }
    })
}

// 获取可审核数量
function get_SemiFinishProductList(){
    getSemiFinishProductList({per_page:1000}).then(res=>{
        if(res.code==200){
           let msg= res.data.data.length
           store.state.app.msglist.banchengpinmsg=msg
        }
    })
}


export function getname(){
    getCompanyName().then(res=>{
            console.log(res)
    })
}

